package com.swpu.project.controller;


import com.swpu.project.common.BaseResponse;
import com.swpu.project.model.entity.HeavyMetal;
import com.swpu.project.service.IHeavyMetalService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author swpuyanxiegroup1
 * @since 2024-07-29
 */
@RestController
@RequestMapping("data")
public class HeavyMetalController {
    @Resource
    IHeavyMetalService iHeavyMetalService;

@GetMapping("/heavy/query/{id}")
BaseResponse queryData(@PathVariable(name="id") String belongId)
{
   return iHeavyMetalService.queryData(belongId);


}


@PutMapping("/heavy/update")
    BaseResponse updateHeavy(@RequestBody List<HeavyMetal> heavyMetals)
{
    return BaseResponse.iFSuccess(iHeavyMetalService.updateBatchById(heavyMetals));
}

    @PutMapping("/heavy/updatesingle")
    BaseResponse updateHeavy(@RequestBody HeavyMetal heavyMetal)
    {

        return BaseResponse.iFSuccess(iHeavyMetalService.updateById(heavyMetal));
    }




}
